using GolSig.Library;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;

namespace Test.GolSig.Library.GridSpecs
{
    [TestClass]
    public class WhenMakingCell
    {

        [TestMethod()]
        public void GivenNormalConditions_thenCellInfoIsCorrect()
        {
            Board board = new Board(new BoardSize(3, 3));
            Grid target = new Grid(board);


            Position p11 = new Position(1, 1);

            target.MakeCell(p11, true);

            var current = target.GetCurrentCellInfo(p11);


            Assert.IsTrue(current.Alive);
            Assert.IsTrue(p11.Equals(current.Position));

        }


        [TestMethod(), ExpectedException(typeof(System.ArgumentNullException))]
        public void GivenEmptyPosition_thenShouldRaiseException()
        {
            Board board = new Board(new BoardSize(3, 3));
            Grid target = new Grid(board);

            Position pNull = null;

            target.MakeCell(pNull, true);



            Assert.Fail("expected exception");

        }
    }
}
